package ochart.core
{

	public class ChartFactory implements IChartFactory
	{
		private static var _instance:ChartFactory = null;
		
		public static function get instance():ChartFactory
		{
			if(!_instance)
			{
				_instance = new ChartFactory();
			}
			return _instance;
		}
		
		public function ChartFactory()
		{
		}
		
		public function create(alias:String):ChartBase
		{
			switch(alias)
			{
				case XYChart.ALIAS:
					return new XYChart();
				case PieChart.ALIAS:
					return new PieChart();
			}
			return null;
		}
	}
}